package com.tnsw.coreutils.ui;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

public abstract class UpdateView {
	
	protected Context context;
	protected LayoutInflater inflater=null;
	protected boolean mIsPulling = false;
	
	public UpdateView(Context context) {
		this.context = context;
		inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		
	}
	
	public abstract View getView();
	
	public void onUpdateBegin() {
		
	}
	
	public void onUpdateEnd() {
		
	}
	
	public void onUpdateCancel() {
		
	}
	
	public boolean isPulling() {
		return(this.mIsPulling);
	}
	
	public void onPulling(int deltaY) {
		if (this.mIsPulling == false) {
			this.mIsPulling = true;
		}
	}
	
	public void onRelease() {
		this.mIsPulling = false;
	}
	
	public void onReadyToUpdate() {
		
	}
	
}
